/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50728
 Source Host           : localhost:3306
 Source Schema         : user_center

 Target Server Type    : MySQL
 Target Server Version : 50728
 File Encoding         : 65001

 Date: 11/12/2021 00:07:24
*/

SET NAMES utf8mb4;
SET
    FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for bonus_event_log
-- ----------------------------
DROP TABLE IF EXISTS `bonus_event_log`;
CREATE TABLE `bonus_event_log`
(
    `id`          int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id',
    `user_id`     int(11)                                 DEFAULT NULL COMMENT 'user.id',
    `value`       int(11)                                 DEFAULT NULL COMMENT '积分操作值',
    `event`       varchar(20) COLLATE utf8mb4_unicode_ci  DEFAULT NULL COMMENT '发生的事件',
    `create_time` datetime                                DEFAULT NULL COMMENT '创建时间',
    `description` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '描述',
    PRIMARY KEY (`id`),
    KEY `fk_bonus_event_log_user1_idx` (`user_id`)
) ENGINE = InnoDB
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci COMMENT ='积分变更记录表';

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user`
(
    `id`          int(11)                                 NOT NULL AUTO_INCREMENT COMMENT 'Id',
    `wx_id`       varchar(64) COLLATE utf8mb4_unicode_ci  NOT NULL DEFAULT '' COMMENT '微信id',
    `wx_nickname` varchar(64) COLLATE utf8mb4_unicode_ci  NOT NULL DEFAULT '' COMMENT '微信昵称',
    `roles`       varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '角色',
    `avatar_url`  varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '头像地址',
    `create_time` datetime                                NOT NULL COMMENT '创建时间',
    `update_time` datetime                                NOT NULL COMMENT '修改时间',
    `bonus`       int(11)                                 NOT NULL DEFAULT '300' COMMENT '积分',
    PRIMARY KEY (`id`)
) ENGINE = InnoDB
  AUTO_INCREMENT = 2
  DEFAULT CHARSET = utf8mb4
  COLLATE = utf8mb4_unicode_ci COMMENT ='分享';

-- ----------------------------
-- Records of user
-- ----------------------------
BEGIN;
INSERT INTO `user`
VALUES (1, '', '', '', '', '2021-05-04 06:34:35', '2021-05-04 06:34:35', 300);
COMMIT;

SET
    FOREIGN_KEY_CHECKS = 1;
